<?php
	include_once 'autoload.php';
	

	session_start();

	$ctl = new ConfirmAlbumCtl();
	$ctl->checkLogged();
	$ctl->checkNotReadonly();
	$ctl->proceed();
	
	$header = new Header();
	$header->render('Confirm Delete Album');

	$form = $ctl->getConfirmAlbumForm();

	$albums = $form->getAlbums();
?>
<form method="post">
<input type="hidden" name="pagename" value="confirmalbum" id="pgid">
<input type="hidden" name="metname" value="" id="metid">
<h2>Confirm Delete Albums</h2>
<table cellpadding="8" cellspacing="0" class="pictures">
<?php
if(is_array($albums)){
	foreach($albums as $current){
		$name = htmlspecialchars($current->getName());
		$pictureId = $current->getPictureId();
		
		$url = "smallimage.php?id={$pictureId}"; 
?>
  <tr>
    <td class="label"><div style="width: 200px; text-align: left; "><?php echo $name; ?></div></td>
    <td class="label">
    	<img src="<?php echo $url; ?>">
    </td>
 </tr>
 <?php 
	}
}
 ?>
</table>

<p>
  <input type="button" value="Confirm" onclick="triggerform('submit')" class="enter">
  <input type="button" value="Cancel" onclick="triggerform('cancel')" class="escape">
</p>
</form>
<?php
	$footer = new Footer();
	$footer->render();
?>
